package mipushdemo.xiaomi.com.diyitonghang.api;

import java.util.Map;

import io.reactivex.Observable;
import mipushdemo.xiaomi.com.diyitonghang.app.AppUrl;
import mipushdemo.xiaomi.com.diyitonghang.data.bean.HomeDataBean;
import mipushdemo.xiaomi.com.diyitonghang.data.bean.HuaBean;
import mipushdemo.xiaomi.com.diyitonghang.data.bean.InfoBean;
import mipushdemo.xiaomi.com.diyitonghang.data.bean.LoginBean;
import mipushdemo.xiaomi.com.diyitonghang.data.bean.NewsChannelData;
import mipushdemo.xiaomi.com.diyitonghang.data.bean.SearchBean;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface ApiService {

    @POST(AppUrl.URL_sendVerificationCode)
    Observable<ResponseBody> getYanZhengMa(@Header("Content-Type") String header, @Body RequestBody body);

    @POST(AppUrl.URL_PhoneLogin)
    Observable<LoginBean> phoneLogin(@Header("Content-Type") String header, @Body RequestBody body);

    @POST(AppUrl.URL_listNewsChannel)
    Observable<NewsChannelData> homeType(@Header("Content-Type") String header);

    @POST(AppUrl.URL_upListNews)
    Observable<HomeDataBean> homeData(@Header("Content-Type") String header, @Body RequestBody body);

    @POST(AppUrl.URL_downListNews)
    Observable<HomeDataBean> homeLoadMoreData(@Header("Content-Type") String header, @Body RequestBody body);

    @POST(AppUrl.URL_hot)
    Observable<ResponseBody> homeSearchData(@Header("Content-Type") String header);

    @POST(AppUrl.URL_search)
    Observable<SearchBean> newsSearch(@Header("Content-Type") String header, @Body RequestBody body);

    @POST(AppUrl.URL_topic_search)
    Observable<HuaBean> topicSearch(@Header("Content-Type") String header, @Body RequestBody body);

    @FormUrlEncoded
    @Headers("Content-Type:application/x-www-form-urlencoded;charset=UTF-8")
    @POST(AppUrl.URL_news_info)
    Observable<InfoBean> infoData(@Field("userId")String userId, @Field("newsId")String newsId);


}
